package com.ruoyi.client.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.ruoyi.client.service.IBlogUserService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.bo.RegisterBody;
import com.ruoyi.common.web.core.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("client/user/register")
public class UserRegisterController extends BaseController {
    @Autowired
    IBlogUserService userService;
    @PostMapping
    @SaIgnore
    public R<Void> register(@RequestBody @Validated RegisterBody body){
        userService.register(body);
        return toAjax(true);
    }
}
